﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 事件触发
{
    public partial class Form1 : Form
    {

        public delegate void TriggerCallbackHandler(object sender, EventArgsTest e);
        public static event TriggerCallbackHandler TriggerCallback;

        private void MsgShow(object sender, EventArgsTest e)
        {
            Console.WriteLine(e._msg);
        }

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            var args = new EventArgsTest("Event Test!");
            TriggerCallback = new TriggerCallbackHandler(MsgShow);
            TriggerCallback?.Invoke(this, args);
        }
    }
}
